package org.example.ch01.p05;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        while(scanner.hasNextLine()){
            String choice=scanner.nextLine().trim();
            System.out.println("choice" + choice);
            if(choice.equals("double")){
                double a=scanner.nextDouble();
                double b= scanner.nextDouble();
                double c=scanner.nextDouble();
                scanner.nextLine();
                System.out.printf("%-5.2f,%5.2f,%.2f\n",a,b,c);
            }else if(choice.equals("line")){
                String Line=scanner.nextLine().trim();
                System.out.println(Line.toUpperCase());
            }else if(choice.equals("int")){
                int a=scanner.nextInt();
                int b=scanner.nextInt();
                int c=scanner.nextInt();
                scanner.nextLine();
                System.out.println(a + b + c);
            }else if(choice.equals("str")){
                String s1=scanner.next().trim();
                String s2=scanner.next().trim();
                String s3=scanner.next().trim();
                scanner.nextLine();
                System.out.println(s3 + s2 + s1);
            }else if(choice.equals("end")){
                System.out.println("other");
                break;
            }else{
                System.out.println("other");
            }
        }
        scanner.close();
    }
}
